<template>
  <basic-container>
    <admin-home v-if="userRight == 1"></admin-home>
    <seller-home v-if="userRight == 2"></seller-home>
  </basic-container>
</template>

<script>
import { mapGetters } from "vuex";
import adminHome from '@/components/index/adminHome';
import sellerHome from '@/components/index/sellerHome';
import {  getStore} from '@/util/store'
export default {
  name: "wel",
  data () {
    return {

    }
  },
  components: {
    adminHome,
    sellerHome
  },
  computed: {
    ...mapGetters(["userInfo"]),
    userRight () {
      let roleids = this.userInfo.roleIds;
      console.log('includes',roleids.includes(1,10,11,12))
      if(roleids.includes(1) || roleids.includes(10) || roleids.includes(11) || roleids.includes(12) || roleids.includes(8)){//检测是否是超级管理员
        return 1;
      }
      if(roleids.includes(2)){//检测是否是卖家
        return 2;
      }
      return 3;//空白
    }
  },
  created () {
	
  },
  mounted() {
	  this.$nextTick(function () {
	     let isNeedModifyPassword = getStore({ name: 'isNeedModifyPassword' })
	     if(isNeedModifyPassword){
	     	this.$router.push({ path: '/info/setting' });
	     }
	    })
  
  },
  methods: {}
};
</script>

<style scoped="scoped" lang="scss">
</style>
